﻿using Microsoft.Extensions.Logging;
using DailyPoetryH.Library.Services;
using DailyPoetryH.Services;

namespace DailyPoetryH;

public static class MauiProgram {
    public static MauiApp CreateMauiApp() {
        var builder = MauiApp.CreateBuilder();
        builder.UseMauiApp<App>().ConfigureFonts(fonts => {
            fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
        });

        builder.Services.AddScoped<IAlertService, AlertService>();
        builder.Services.AddScoped<IPreferenceStorage, PreferenceStorage>();
        builder.Services.AddScoped<IPoetryStorage, PoetryStorage>();
        builder.Services.AddScoped<IFavoriteStorage, FavoriteStorage>();
        builder.Services.AddScoped<INavigationService, NavigationService>();
        builder.Services.AddSingleton<IParcelBoxService, ParcelBoxService>();
        builder.Services.AddScoped<ITodayPoetryService, JinrishiciService>();
        builder.Services.AddScoped<ITodayImageService, BingImageService>();
        builder.Services.AddScoped<ITodayImageStorage, TodayImageStorage>();
        builder.Services.AddScoped<IPhotoService, PhotoService>();
        builder.Services
            .AddScoped<IPoetrilizationService, PoetrilizationService>();

        builder.Services.AddMauiBlazorWebView();
        builder.Services.AddBootstrapBlazor();

#if DEBUG
        builder.Services.AddBlazorWebViewDeveloperTools();
        builder.Logging.AddDebug();
#endif

        return builder.Build();
    }
}